/**
 * Created by lixin on 2019-09-17
 */
const HttpService = require('egg').Service;
const RequestUrl = require('../utils/url');

class ContractService extends HttpService {


    async getContract(payload) {


        // TODO 判定传参 必传是否传，类型是否正确...

        const {ctx} = this;

        const url = RequestUrl.CONTRACT_FIND;

        // 请求数据
        const result = await ctx.request.request(this, url, payload);

        // TODO 返回数据需要做处理可以在这
        // TODO

        // 接口返回数据
        const data = result.data;

        if (data.code === '000000') {
            return data.data;
        } else {
            return null;
        }

    }

}

module.exports = ContractService;
